﻿Public Class viewearnings
    Dim item As ListViewItem
    Sub listdata()
        If Not rs.EOF Then
            ListView1.Items.Clear()
            rs.MoveFirst()
            Do While Not rs.EOF
                item = ListView1.Items.Add(rs.Fields("total").Value)



                rs.MoveNext()

            Loop
        Else
            ListView1.Items.Clear()

        End If
        rs.Close()
        rs = Nothing
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Module1.connect()
        rs = New ADODB.Recordset
        rs.Open("SELECT sum(totalamountearned) AS total FROM Query3 where month(date1) = " & TextBox1.Text & " and year(date1) = " & TextBox2.Text & "", cn, 3, 2)
        Me.listdata()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        report.Show()
        Me.Hide()
    End Sub
End Class